<?php
class Login extends CI_Controller {
	function __construct() {
		parent::__construct ();
		$this->load->helper ( 'form' );
		$this->load->model ( array ("CpyInfo",'UserManager') );
	}
	
	function index() {
		$data ['title'] = "Login";
		$data ['vo'] = $this->CpyInfo->getCpyInfoById ( 1 );
		$this->load->view ( "login", $data );
	}
	
	function checkIn() {
		$isLogin = $this->UserManager->checkLogin ( $this->input->post ( 'loginName' ), $this->input->post ( 'pwd' ) );
		if ($isLogin) {
			$this->session->set_userdata ( USER_KEY, $this->UserManager->getUserObj ( $this->input->post ( 'loginName' ) ) );
			$data ['result'] = 'login success!';
		} else
			$data ['result'] = 'login fail!';
		$data ['title'] = 'login result';
		$data ['vo'] = $this->CpyInfo->getCpyInfoById ( 1 );
		$this->load->view ( "manager/loginResult", $data );
	}

}

?>